package com.tencent.tws.watchfacelib;

import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

public class WatchFaceBattery
{
  private Context mContext;
  private boolean mIsCharging;
  private boolean mIsFull;
  private boolean mIsLow;
  private float mLevel;
  
  public WatchFaceBattery(Context paramContext)
  {
    this.mContext = paramContext;
  }
  
  public void checkBatteryState()
  {
    Object localObject = new IntentFilter("android.intent.action.BATTERY_CHANGED");
    localObject = this.mContext.registerReceiver(null, (IntentFilter)localObject);
    switch (((Intent)localObject).getIntExtra("status", -1))
    {
    case 3: 
    case 4: 
    default: 
      this.mIsFull = false;
      this.mIsCharging = false;
    }
    for (;;)
    {
      int i = ((Intent)localObject).getIntExtra("scale", 100);
      this.mLevel = (((Intent)localObject).getIntExtra("level", i) / i);
      if (this.mLevel >= 0.1D) {
        break;
      }
      this.mIsLow = true;
//      return;
      this.mIsCharging = true;
//      continue;
      this.mIsCharging = true;
    }
    this.mIsLow = false;
  }
}


/* Location:              G:\zyl\ylwork\Android\Android_Decode\apk2java\apktool2.1.0\WatchFaceSports\classes-dex2jar.jar!\com\tencent\tws\watchfacelib\WatchFaceBattery.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */